﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:tc="clr-namespace:Microsoft.Coding4Fun.TweetCraft.Tray"
    x:Class="Microsoft.Coding4Fun.TweetCraft.Tray.SettingsWindow"
    Title="TweetCraft Settings" Width="363" Height="593" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Background="{x:Null}" WindowStyle="None" AllowsTransparency="True" Icon="Images/Icon.png">
    <Window.Resources>
        <Storyboard x:Key="BirdHop" RepeatBehavior="Forever">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="BirdImage" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="40"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="80"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="80"/>
                <DiscreteDoubleKeyFrame KeyTime="00:00:01.0500000" Value="120"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02" Value="120"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02.1000000" Value="80"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02.2000000" Value="40"/>
                <SplineDoubleKeyFrame KeyTime="00:00:03" Value="40"/>
                <DiscreteDoubleKeyFrame KeyTime="00:00:03.0500000" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="BirdImage" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeySpline="0,0,0.5,1" KeyTime="00:00:00.1000000" Value="-30"/>
                <SplineDoubleKeyFrame KeySpline="0.5,0,1,1" KeyTime="00:00:00.2000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="0"/>
                <SplineDoubleKeyFrame KeySpline="0,0,0.5,1" KeyTime="00:00:01.0500000" Value="-10"/>
                <SplineDoubleKeyFrame KeySpline="0.5,0,1,1" KeyTime="00:00:01.1000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02.1000000" Value="-30" KeySpline="0,0,0.5,1"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02.2000000" Value="0" KeySpline="0.5,0,1,1"/>
                <SplineDoubleKeyFrame KeyTime="00:00:03" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:03.0500000" Value="-10" KeySpline="0,0,0.5,1"/>
                <SplineDoubleKeyFrame KeyTime="00:00:03.1000000" Value="0" KeySpline="0.5,0,1,1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="BirdImage" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeySpline="0,0,0.5,1" KeyTime="00:00:00.1000000" Value="23"/>
                <SplineDoubleKeyFrame KeySpline="0.5,0,1,1" KeyTime="00:00:00.2000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02.1000000" Value="-23" KeySpline="0,0,0.5,1"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02.2000000" Value="0" KeySpline="0.5,0,1,1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="BirdImage" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="1"/>
                <DiscreteDoubleKeyFrame KeyTime="00:00:01.0500000" Value="-1"/>
                <SplineDoubleKeyFrame KeyTime="00:00:03" Value="-1"/>
                <DiscreteDoubleKeyFrame KeyTime="00:00:03.0500000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </Window.Resources>
    <Window.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard Storyboard="{StaticResource BirdHop}"/>
        </EventTrigger>
    </Window.Triggers>
    <Window.DataContext>
        <tc:SettingsContext />
    </Window.DataContext>
    <Grid Height="532">
        <Image HorizontalAlignment="Left" VerticalAlignment="Top" Width="318" Height="431" Source="Images\Background.png" Stretch="Fill" Margin="22,46,0,0">
            <Image.Effect>
                <DropShadowEffect BlurRadius="10" ShadowDepth="5"/>
            </Image.Effect>
        </Image>
        <Image HorizontalAlignment="Left" VerticalAlignment="Top" Width="347" Height="85" Source="Images\Logo.png" Stretch="Fill" Margin="6,86,0,0" MouseDown="OnTitleBarMouseDown">
            <Image.Effect>
                <DropShadowEffect ShadowDepth="5" BlurRadius="10"/>
            </Image.Effect>
        </Image>
        <StackPanel Background="{x:Null}" HorizontalAlignment="Center" Margin="0,180,4,0" Width="250" VerticalAlignment="Top">
            <Button Content="Sign In" Click="OnAuthorizedClicked" Style="{DynamicResource WoWButtonStyle}" />
            <Label Content="Twitter PIN" Foreground="#FF000000" Style="{DynamicResource WoWLabelStyle}" HorizontalAlignment="Center" Margin="0,0,0,-4" />
            <PasswordBox x:Name="twitterPasswordBox" Height="35" LostFocus="PasswordBox_LostFocus" VerticalAlignment="Center" Style="{DynamicResource WoWPasswordBoxStyle}" />
            <Label Content="{Binding Path=TwitterValidationStatus}" HorizontalAlignment="Center" Foreground="{Binding TwitterValidationStatusForeground}" FontSize="16" Style="{DynamicResource WoWLabelStyle}" Margin="0,0,0,8" />
            <Label Content="World of Warcraft Account" Foreground="#FF000000" Style="{DynamicResource WoWLabelStyle}" Margin="0,0,0,-4" />
            <ComboBox ItemsSource="{Binding Path=WowAccounts}" SelectedItem="{Binding Path=WowAccount}"  Grid.Row="4" Grid.Column="1" Style="{DynamicResource WoWComboBoxStyle}" Height="35" Margin="0,0,0,4" />
            <StackPanel Orientation="Horizontal" Margin="0,0,0,8" HorizontalAlignment="Center">
                <CheckBox VerticalAlignment="Center" HorizontalAlignment="Left" IsChecked="{Binding Path=AutoTweetScreenshots}" Style="{DynamicResource WoWCheckBoxStyle}"/>
                <Label Content="AutoTweet Screenshots" Foreground="#FF000000" Style="{DynamicResource WoWLabelStyle}" FontSize="16" />
            </StackPanel>
            <StackPanel Height="34" Orientation="Horizontal">
                <Button Content="Apply" Click="OnApplyClicked" Style="{DynamicResource WoWButtonStyle}" />
                <Button Content="OK" Click="OnOKClicked" Style="{DynamicResource WoWButtonStyle}" Margin="33,0,0,0" />
            </StackPanel>
        </StackPanel>
        <Image x:Name="BirdImage" HorizontalAlignment="Left" VerticalAlignment="Top" Width="110" Height="95" Source="Images\Logo_bird.png" Stretch="Fill" Margin="17,20,0,0" RenderTransformOrigin="0.5,0.5">
            <Image.RenderTransform>
                <TransformGroup>
                    <ScaleTransform ScaleX="1" ScaleY="1"/>
                    <SkewTransform AngleX="0" AngleY="0"/>
                    <RotateTransform Angle="0"/>
                    <TranslateTransform X="0" Y="0"/>
                </TransformGroup>
            </Image.RenderTransform>
        </Image>
        <Button HorizontalAlignment="Right" VerticalAlignment="Top" Content="Cancel" Margin="0,68,33,0" Click="OnCancelClicked" Style="{DynamicResource WowCloseButtonStyle}"/>
    </Grid>
</Window>
